<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>PWA 插件 | VuePress</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="icon" href="/logo.png">
    <link rel="manifest" href="/manifest.json">
    <link rel="apple-touch-icon" href="/icons/apple-touch-icon-152x152.png">
    <link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#3eaf7c">
    <script data-ad-client="ca-pub-2245427233262012" async="true" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <meta name="description" content="愿半生编码，如一生好友。">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/assets/css/0.styles.fca152ce.css" as="style"><link rel="preload" href="/assets/js/app.28715422.js" as="script"><link rel="preload" href="/assets/js/5.cdfc0b9f.js" as="script"><link rel="preload" href="/assets/js/44.aab84de2.js" as="script"><link rel="preload" href="/assets/js/9.4c44b987.js" as="script"><link rel="prefetch" href="/assets/js/10.84acbb53.js"><link rel="prefetch" href="/assets/js/11.702efeb3.js"><link rel="prefetch" href="/assets/js/12.589fb250.js"><link rel="prefetch" href="/assets/js/13.5b7e8614.js"><link rel="prefetch" href="/assets/js/14.a954bfd1.js"><link rel="prefetch" href="/assets/js/15.bd11c63a.js"><link rel="prefetch" href="/assets/js/16.b4fb7988.js"><link rel="prefetch" href="/assets/js/17.61d84266.js"><link rel="prefetch" href="/assets/js/18.24a2bff9.js"><link rel="prefetch" href="/assets/js/19.43d31d8f.js"><link rel="prefetch" href="/assets/js/20.b22f54d0.js"><link rel="prefetch" href="/assets/js/21.9c07bc91.js"><link rel="prefetch" href="/assets/js/22.32e1eb60.js"><link rel="prefetch" href="/assets/js/23.093427d3.js"><link rel="prefetch" href="/assets/js/24.e648d309.js"><link rel="prefetch" href="/assets/js/25.d7282ca4.js"><link rel="prefetch" href="/assets/js/26.35acf93d.js"><link rel="prefetch" href="/assets/js/27.56ca4ce1.js"><link rel="prefetch" href="/assets/js/28.93379c82.js"><link rel="prefetch" href="/assets/js/29.51d63262.js"><link rel="prefetch" href="/assets/js/30.1b336946.js"><link rel="prefetch" href="/assets/js/31.e297de45.js"><link rel="prefetch" href="/assets/js/32.4bae9555.js"><link rel="prefetch" href="/assets/js/33.4239fd2e.js"><link rel="prefetch" href="/assets/js/34.bbc16b3c.js"><link rel="prefetch" href="/assets/js/35.f16977ac.js"><link rel="prefetch" href="/assets/js/36.6141cdc8.js"><link rel="prefetch" href="/assets/js/37.43f5a7f6.js"><link rel="prefetch" href="/assets/js/38.01c53507.js"><link rel="prefetch" href="/assets/js/39.21f63708.js"><link rel="prefetch" href="/assets/js/40.f9f38954.js"><link rel="prefetch" href="/assets/js/41.0175e1f4.js"><link rel="prefetch" href="/assets/js/42.422cba18.js"><link rel="prefetch" href="/assets/js/43.3d77a131.js"><link rel="prefetch" href="/assets/js/45.ac7ca1c5.js"><link rel="prefetch" href="/assets/js/46.9982952d.js"><link rel="prefetch" href="/assets/js/47.d4c85adf.js"><link rel="prefetch" href="/assets/js/48.d00a7fe9.js"><link rel="prefetch" href="/assets/js/49.03487062.js"><link rel="prefetch" href="/assets/js/50.bbfd00cd.js"><link rel="prefetch" href="/assets/js/51.1ef38ba0.js"><link rel="prefetch" href="/assets/js/52.f352c22a.js"><link rel="prefetch" href="/assets/js/53.fa377a7b.js"><link rel="prefetch" href="/assets/js/54.16d81c63.js"><link rel="prefetch" href="/assets/js/55.b2e1b9f2.js"><link rel="prefetch" href="/assets/js/56.99f69695.js"><link rel="prefetch" href="/assets/js/57.54be906e.js"><link rel="prefetch" href="/assets/js/58.e28944e4.js"><link rel="prefetch" href="/assets/js/59.647fcd7b.js"><link rel="prefetch" href="/assets/js/6.8f67e34e.js"><link rel="prefetch" href="/assets/js/60.ed875cf2.js"><link rel="prefetch" href="/assets/js/61.d244e754.js"><link rel="prefetch" href="/assets/js/62.82572383.js"><link rel="prefetch" href="/assets/js/63.afac6e14.js"><link rel="prefetch" href="/assets/js/64.1793ed0c.js"><link rel="prefetch" href="/assets/js/65.75847d31.js"><link rel="prefetch" href="/assets/js/66.a613f673.js"><link rel="prefetch" href="/assets/js/67.374e7e54.js"><link rel="prefetch" href="/assets/js/7.2df5fd3a.js"><link rel="prefetch" href="/assets/js/8.79c44677.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.b3708bf9.js"><link rel="prefetch" href="/assets/js/vendors~flowchart.3b4fa92d.js"><link rel="prefetch" href="/assets/js/vendors~notification.11c6c6d5.js">
    <link rel="stylesheet" href="/assets/css/0.styles.fca152ce.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">赵小云学习笔记</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="/notes/" class="nav-link router-link-active">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/notes/" class="nav-link router-link-active">
  notes
</a></div><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/config/" class="nav-link">
  配置
</a></div><div class="nav-item"><a href="/plugin/" class="nav-link">
  插件
</a></div><div class="nav-item"><a href="/theme/" class="nav-link">
  主题
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="了解更多" class="dropdown-title"><span class="title">了解更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="了解更多" class="mobile-dropdown-title"><span class="title">了解更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          API
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/api/cli.html" class="nav-link">
  CLI
</a></li><li class="dropdown-subitem"><a href="/zh/api/node.html" class="nav-link">
  Node
</a></li></ul></li><li class="dropdown-item"><h4>
          开发指南
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/local-development.html" class="nav-link">
  本地开发
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/design-concepts.html" class="nav-link">
  设计理念
</a></li><li class="dropdown-subitem"><a href="/zh/faq/" class="nav-link">
  FAQ
</a></li><li class="dropdown-subitem"><a href="/zh/miscellaneous/glossary.html" class="nav-link">
  术语
</a></li></ul></li><li class="dropdown-item"><h4>
          其他
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/zh/miscellaneous/migration-guide.html" class="nav-link">
  从 0.x 迁移
</a></li><li class="dropdown-subitem"><a href="https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Changelog
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://v0.vuepress.vuejs.org/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  0.x
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/vuejs/vuepress" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>职场故事</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/notes/" aria-current="page" class="sidebar-link">主题</a></li><li><a href="/notes/程序员和数学.html" class="active sidebar-link">pwa</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#一、前言" class="sidebar-link">一、前言</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#二、把代码写好的四步" class="sidebar-link">二、把代码写好的四步</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#三、for循环没算法快" class="sidebar-link">三、for循环没算法快</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#四、java中的算法运用" class="sidebar-link">四、Java中的算法运用</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#五、程序员数学入门" class="sidebar-link">五、程序员数学入门</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#六、总结" class="sidebar-link">六、总结</a></li><li class="sidebar-sub-header"><a href="/notes/程序员和数学.html#七、系列推荐" class="sidebar-link">七、系列推荐</a></li></ul></li><li><a href="/notes/using-a-theme.html" class="sidebar-link">使用主题</a></li><li><a href="/notes/writing-a-theme.html" class="sidebar-link">开发主题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="程序员和数学"><a href="#程序员和数学" class="header-anchor">#</a> 程序员和数学</h1> <p>作者：赵小云
<br>博客：<a href="https://bugstack.cn" target="_blank" rel="noopener noreferrer">https://bugstack.cn<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <blockquote><p>愿半生编码，如一生好友。😄</p></blockquote> <h2 id="一、前言"><a href="#一、前言" class="header-anchor">#</a> 一、前言</h2> <p><code>数学离程序员有多近？</code></p> <p>ifelse也好、for循环也罢，代码可以说就是对<strong>数学逻辑的具体实现</strong>。所以敲代码的程序员几乎就离不开数学，难易不同而已。</p> <p>那数学不好就写不了代码吗😳？不，一样可以写代码，可以写出更多的<code>CRUD</code>出来。那你不要总觉得是产品需求简单所以你的实现过程才变成了增删改查，往往也是因为你还不具备可扩展、易维护、高性能的代码实现方案落地能力，才使得你小小年纪写出了更多的<code>CRUD</code>！</p> <p>与一锥子买卖的小作坊相比，大厂和超级大厂更会注重数学能力。</p> <p><img src="https://img-blog.csdnimg.cn/img_convert/7745132909255f75eec729e3fb121144.png" alt="first 10-digit prime found in consecutive digits of e"></p> <p><strong>2004年</strong>，在硅谷的交通动脉 101 公路上突然出现一块巨大的广告牌，上面是一道数学题：<code>{e 的连续数字中最先出现的 10 位质数}</code>.com。</p> <p>广告：这里的 e 是数学常数，自然对数的底数，无限不循环小数。这道题的意思就是，找出 e 中最先出现的 10 位质数，然后可以得出一个网址。进入这个网址会看到 Google 为你出的第二道数学题，成功解锁这步 Google 会告诉你，<code>我们或许是”志同道合“的人</code>，你可以将简历发到这个邮箱，我们一起做点改变世界的事情。</p> <p><em>计算 e 值可以通过泰勒公式推导出来：e^x≈1 + x + x^2/2! + x^3/3! +……+ x^n/n! (1) 推导计算过程还包括<code>埃拉托色尼筛选法(the Sieve of Eratosthenes)</code>、<code>线性筛选法</code>的使用。感兴趣的小伙伴可以用代码实现下。</em></p> <h2 id="二、把代码写好的四步"><a href="#二、把代码写好的四步" class="header-anchor">#</a> 二、把代码写好的四步</h2> <p><code>业务提需求、产品定方案、研发做实现。</code>最终这个系统开发的怎么样是由三方共同决定的！</p> <ul><li>地基挖的不好，楼就盖不高</li> <li>砖头摆放不巧，楼就容易倒</li> <li>水电走线不妙，楼就危险了</li> <li>格局设计不行，楼就卖不掉</li></ul> <p>这里的地基、砖头、水电、格局，对应的就是，数据结构、算法逻辑、设计模式、系统架构。从下到上相互依赖、相互配合，只有这一层做好，下一层才好做！</p> <p><img src="https://img-blog.csdnimg.cn/img_convert/81932358d52d2f0d5e02429983036c61.png" alt="图 20-2 代码实现过程分层"></p> <ul><li><strong>数据结构</strong>：高矮胖瘦、长宽扁细，数据的存放方式，是一套程序开发的核心基础。不合理的设计往往是从数据结构开始，哪怕你仅仅是使用数据库存放业务信息，也一样会影响到将来各类数据的查询、汇总等实现逻辑的难易。</li> <li><strong>算法逻辑</strong>：是对数据结构的使用，合适的数据结构会让算法实现过程降低时间复杂度。可能你现在的多层for循环在合适的算法过程下，能被优化为更简单的方式获取数据。<em>注意：算法逻辑实现，并不一定就是排序、归并，还有你实际业务的处理流程。</em></li> <li><strong>设计模式</strong>：可以这么说，不使用设计模式你一样能写代码。但你愿意看到满屏幕的ifelse判断调用，还是喜欢像膏药一样的代码，粘贴来复制去？那么设计模式这套通用场景的解决方案，就是为你剔除掉代码实现过程中的恶心部分，让整套程序更加易维护、易扩展。<em>就是开发完一个月，你看它你还认识！</em></li> <li><strong>系统架构</strong>：描述的是三层MVC，还是四层DDD。我对这个的理解就是家里的三居还是四局格局，MVC是我们经常用的大家都熟悉，DDD无非就是家里多了个书房，把各自属于哪一个屋子的摆件规整到各自屋子里。<em>那么乱放是什么效果呢，就是自动洗屁屁马桶🚽给按到厨房了，再贵也格楞子！</em> 好，那么我们在延展下，如果你的卫生间没有流出下水道咋办？是不这个地方的数据结构就是设计缺失的，而到后面再想扩展就难了吧！</li></ul> <p>所以，研发在承接业务需求、实现产品方案的时候。压根就不只是在一个房子的三居或者四居格局里，开始随意码砖。</p> <p>没有合理的数据结构、没有优化的算法逻辑、没有运用的设计模式，最终都会影响到整个系统架构变得臃肿不堪，调用混乱。在以后附加、迭代、新增的需求下，会让整个系统问题不断的放大，当你想用重构时，就有着千丝万缕般调用关系。 <em>重构就不如重写了！</em></p> <h2 id="三、for循环没算法快"><a href="#三、for循环没算法快" class="header-anchor">#</a> 三、for循环没算法快</h2> <p>在《编程之美》一书中，有这样一道题。求：1~n中，1出现的次数。比如：1~10，1出现了两次。</p> <h3 id="_1-for-循环实现"><a href="#_1-for-循环实现" class="header-anchor">#</a> 1. for 循环实现</h3> <div class="language-java extra-class"><pre class="language-java"><code><span class="token keyword">long</span> startTime <span class="token operator">=</span> <span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">currentTimeMillis</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> count <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> <span class="token number">10000000</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name">String</span> str <span class="token operator">=</span> <span class="token class-name">String</span><span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> j <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> str<span class="token punctuation">.</span><span class="token function">length</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> j<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>str<span class="token punctuation">.</span><span class="token function">charAt</span><span class="token punctuation">(</span>j<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">49</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            count<span class="token operator">++</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">&quot;1的个数：&quot;</span> <span class="token operator">+</span> count<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">&quot;计算耗时：&quot;</span> <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">currentTimeMillis</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">-</span> startTime<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot;毫秒&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>使用 for 循环的实现过程很好理解，就是往死了循环。之后把循环到的数字按照字符串拆解，判断每一位是不是数字，是就+1。这个过程很简单，但是时间复杂很高。</p> <h3 id="_2-算法逻辑实现"><a href="#_2-算法逻辑实现" class="header-anchor">#</a> 2. 算法逻辑实现</h3> <p><img src="https://img-blog.csdnimg.cn/img_convert/a6b31abf07647820fc97ac76a2aa3da7.png" alt="图 20-3 1的个数循环规则"></p> <p>如图 20-3 所示，其实我们能发现这个1的个数在100、1000、10000中是有规则的循环出现的。11、12、13、14或者21、31、41、51，以及单个的1出现。最终可以得出通用公式：<code>abcd...=(abc+1)*1+(ab+1)*10+(a+1)*100+(1)*1000...</code>，abcd代表位数。另外在实现的过程还需要考虑比如不足100等情况，例如98、1232等。</p> <p><strong>实现过程</strong></p> <div class="language-java extra-class"><pre class="language-java"><code><span class="token keyword">long</span> startTime <span class="token operator">=</span> <span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">currentTimeMillis</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> num <span class="token operator">=</span> <span class="token number">10000000</span><span class="token punctuation">,</span> saveNum <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">,</span> countNum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> lastNum <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> copyNum <span class="token operator">=</span> num<span class="token punctuation">;</span>
<span class="token keyword">while</span> <span class="token punctuation">(</span>num <span class="token operator">!=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    lastNum <span class="token operator">=</span> num <span class="token operator">%</span> <span class="token number">10</span><span class="token punctuation">;</span>
    num <span class="token operator">/=</span> <span class="token number">10</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>lastNum <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 如果是0那么正好是少了一次所以num不加1了</span>
        countNum <span class="token operator">+=</span> num <span class="token operator">*</span> saveNum<span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>lastNum <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 如果是1说明当前数内少了一次所以num不加1，而且当前1所在位置</span>
        <span class="token comment">// 有1的个数，就是去除当前1最高位，剩下位数，的个数。</span>
        countNum <span class="token operator">+=</span> num <span class="token operator">*</span> saveNum <span class="token operator">+</span> copyNum <span class="token operator">%</span> saveNum <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token comment">// 如果非1非0.直接用公式计算</span>
        <span class="token comment">// abcd...=(abc+1)*1+(ab+1)*10+(a+1)*100+(1)*1000...</span>
        countNum <span class="token operator">+=</span> <span class="token punctuation">(</span>num <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">*</span> saveNum<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    saveNum <span class="token operator">*=</span> <span class="token number">10</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">&quot;1的个数：&quot;</span> <span class="token operator">+</span> countNum<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">&quot;计算耗时：&quot;</span> <span class="token operator">+</span> <span class="token punctuation">(</span><span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">currentTimeMillis</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">-</span> startTime<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token string">&quot;毫秒&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>在《编程之美》一书中还不只这一种算法，感兴趣的小伙伴可以查阅。<em>但自己折腾实现后的兴奋感更强哦！</em></p> <h3 id="_3-耗时曲线对比"><a href="#_3-耗时曲线对比" class="header-anchor">#</a> 3. 耗时曲线对比</h3> <p>按照两种不同方式的实现逻辑，我们来计算1000、10000、10000到一个亿，求1出现的次数，看看两种方式的耗时曲线。</p> <p><img src="https://img-blog.csdnimg.cn/img_convert/10c760752fae600ad4afc7536143c124.png" alt="图 20-4 耗时曲线对比"></p> <ul><li>for循环随着数量的不断增大后，已经趋近于无法使用了。</li> <li>算法逻辑依靠的计算公式，所以无论增加多少基本都会在1~2毫秒内计算完成。</li></ul> <p><strong>那么</strong>，你的代码中是否也有类似的地方。如果使用算法逻辑配合适合的数据结构，是否可以替代一些for循环的计算方式，来使整个实现过程的时间复杂度降低。</p> <h2 id="四、java中的算法运用"><a href="#四、java中的算法运用" class="header-anchor">#</a> 四、Java中的算法运用</h2> <p>在 Java 的 JDK 实现中有很多数学知识的运用，包括数组、链表、红黑树的数据结构以及相应的实现类ArrayList、Linkedlist、HashMap等。当你深入的了解这些类的实现后，会发现它们其实就是使用代码来实现数学逻辑而已。<em>就像你使用数学公式来计算数学题一样</em></p> <p>接下来赵小云就给你介绍几个隐藏在我们代码中的数学知识。</p> <h3 id="_1-hashmap的扰动函数"><a href="#_1-hashmap的扰动函数" class="header-anchor">#</a> 1. HashMap的扰动函数</h3> <p><strong>未使用扰动函数</strong></p> <p><img src="https://img-blog.csdnimg.cn/img_convert/74018c3f3eccd2d28b0dca8fd846f751.png" alt="未使用扰动函数，数据分布"></p> <p><strong>已使用扰动函数</strong></p> <p><img src="https://img-blog.csdnimg.cn/img_convert/7f65b497de7a4a5b1f49d9c1e7bdd304.png" alt="未使用扰动函数，数据分布"></p> <p><strong>扰动函数公式</strong></p> <div class="language-java extra-class"><pre class="language-java"><code><span class="token keyword">static</span> <span class="token keyword">final</span> <span class="token keyword">int</span> <span class="token function">hash</span><span class="token punctuation">(</span><span class="token class-name">Object</span> key<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">int</span> h<span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span>key <span class="token operator">==</span> <span class="token keyword">null</span><span class="token punctuation">)</span> <span class="token operator">?</span> <span class="token number">0</span> <span class="token operator">:</span> <span class="token punctuation">(</span>h <span class="token operator">=</span> key<span class="token punctuation">.</span><span class="token function">hashCode</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">^</span> <span class="token punctuation">(</span>h <span class="token operator">&gt;&gt;&gt;</span> <span class="token number">16</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><ul><li><strong>描述</strong>：以上这段代码是HashMap中用于获取hash值的扰动函数实现代码。<em>HashMap通过哈希值与桶定位坐标</em> 那么直接获取哈希值就好了，这里为什么要做一次扰动呢？</li> <li><strong>作用</strong>：为了证明扰动函数的作用，这里选取了10万单词计算哈希值分布在128个格子里。之后把这128个格子中的数据做图表展示。从实现数据可以看到，在使用扰动函数后，曲线更加平稳了。那么，也就是扰动后哈希碰撞会更小。</li> <li><strong>用途</strong>：当你有需要把数据散列分散到不同格子或者空间时，又不希望有太严重的碰撞，那么使用扰动函数就非常有必要了。比如你做的一个数据库路由，在分库分表时也是尽可能的要做到散列的。</li></ul> <h3 id="_2-斐波那契-fibonacci-散列法"><a href="#_2-斐波那契-fibonacci-散列法" class="header-anchor">#</a> 2. 斐波那契（Fibonacci）散列法</h3> <p><img src="https://img-blog.csdnimg.cn/img_convert/4f1e480313fa68ef73268644f4c8490a.png" alt="ThreadLocal 中 斐波那契（Fibonacci）散列法"></p> <ul><li><strong>描述</strong>：在 ThreadLocal 类中的数据存放，使用的是斐波那契（Fibonacci）散列法 + 开放寻址。之所以使用斐波那契数列，是为了让数据更加散列，减少哈希碰撞。具体来自数学公式的计算求值，<strong>公式</strong>：<code>f(k) = ((k * 2654435769) &gt;&gt; X) &lt;&lt; Y对于常见的32位整数而言，也就是 f(k) = (k * 2654435769) &gt;&gt; 28</code></li> <li><strong>作用</strong>：与 HashMap 相比，ThreadLocal的数据结构只有数组，并没有链表和红黑树部分。而且经过我们测试验证，斐波那契散列的效果更好，也更适合 ThreadLocal。</li> <li><strong>用途</strong>：如果你的代码逻辑中需要存储类似 ThreadLocal 的数据结构，又不想有严重哈希碰撞，那么就可以使用 斐波那契（Fibonacci）散列法。其实除此之外还有，<code>除法散列法</code>、<code>平方散列法</code>、<code>随机数法</code>等。</li></ul> <h3 id="_3-梅森旋转算法-mersenne-twister"><a href="#_3-梅森旋转算法-mersenne-twister" class="header-anchor">#</a> 3. 梅森旋转算法（Mersenne twister）</h3> <p><img src="https://img-blog.csdnimg.cn/img_convert/f94eb788652964eff061da6de83a2583.png" alt="梅森旋转算法的三个阶段，来自CSDN博客网图"></p> <div class="language-java extra-class"><pre class="language-java"><code><span class="token comment">// Initializes mt[N] with a simple integer seed. This method is</span>
<span class="token comment">// required as part of the Mersenne Twister algorithm but need</span>
<span class="token comment">// not be made public.</span>
<span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token keyword">void</span> <span class="token function">setSeed</span><span class="token punctuation">(</span><span class="token keyword">int</span> seed<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// Annoying runtime check for initialisation of internal data</span>
    <span class="token comment">// caused by java.util.Random invoking setSeed() during init.</span>
    <span class="token comment">// This is unavoidable because no fields in our instance will</span>
    <span class="token comment">// have been initialised at this point, not even if the code</span>
    <span class="token comment">// were placed at the declaration of the member variable.</span>
    <span class="token keyword">if</span> <span class="token punctuation">(</span>mt <span class="token operator">==</span> <span class="token keyword">null</span><span class="token punctuation">)</span> mt <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token keyword">int</span><span class="token punctuation">[</span><span class="token class-name">N</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token comment">// ---- Begin Mersenne Twister Algorithm ----</span>
    mt<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> seed<span class="token punctuation">;</span>
    <span class="token keyword">for</span> <span class="token punctuation">(</span>mti <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span> mti <span class="token operator">&lt;</span> <span class="token class-name">N</span><span class="token punctuation">;</span> mti<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        mt<span class="token punctuation">[</span>mti<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span>MAGIC_FACTOR1 <span class="token operator">*</span> <span class="token punctuation">(</span>mt<span class="token punctuation">[</span>mti<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">^</span> <span class="token punctuation">(</span>mt<span class="token punctuation">[</span>mti<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">&gt;&gt;&gt;</span> <span class="token number">30</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">+</span> mti<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token comment">// ---- End Mersenne Twister Algorithm ----</span>
<span class="token punctuation">}</span>
</code></pre></div><blockquote><p>梅森旋转算法（Mersenne twister）是一个伪随机数发生算法。由松本真和西村拓士在1997年开发，基于有限二进制字段上的矩阵线性递归。可以快速产生高质量的伪随机数，修正了古典随机数发生算法的很多缺陷。 最为广泛使用Mersenne Twister的一种变体是MT19937，可以产生32位整数序列。</p></blockquote> <ul><li><strong>描述</strong>：梅森旋转算法分为三个阶段，获得基础的梅森旋转链、对于旋转链进行旋转算法、对于旋转算法所得的结果进行处理。</li> <li><strong>用途</strong>：梅森旋转算法是R、Python、Ruby、IDL、Free Pascal、PHP、Maple、Matlab、GNU多重精度运算库和GSL的默认伪随机数产生器。从C++11开始，C++也可以使用这种算法。在Boost C++,Glib和NAG数值库中，作为插件提供。</li></ul> <h2 id="五、程序员数学入门"><a href="#五、程序员数学入门" class="header-anchor">#</a> 五、程序员数学入门</h2> <p>与接触到一个有难度的知识点学起来辛苦相比，是自己不知道自己不会什么！<em>就像上学时候老师说，你不会的就问我。我不会啥？我从哪问？一样一样的！</em></p> <p>代码是对数学逻辑的实现，简单的逻辑调用关系是很容易看明白的。但还有那部分你可能不知道的数学逻辑时，就很难看懂了。比如：扰动函数、负载因子、斐波那契（Fibonacci）等，这些知识点的学习都需要对数学知识进行验证，否则也就学个概念，背个理论。</p> <p>书到用时方恨少，在下还是个宝宝！</p> <p>那如果你想深入的学习下程序员应该会的数学，推荐给你一位科技博主 Jeremy Kun 花了4年时间，写成一本书 <strong>《程序员数学入门》</strong>。</p> <p><img src="https://img-blog.csdnimg.cn/img_convert/0dafd2949e952e77bd1693f76cdc9619.png" alt=" Jeremy Kun，《程序员数学入门》"></p> <p>这本书为程序员提供了大量精简后数学知识，包括：多项式、集合、图论、群论、微积分和线性代数等。同时在wiki部分还包括了抽象代数、离散数学、傅里叶分析和拓扑学等。</p> <p><img src="https://img-blog.csdnimg.cn/img_convert/10b1b8185f7bc2139660250cb7e5ec23.png" alt="《程序员数学入门》书中插图"></p> <p>作者表示，如果你本科学过一些数学知识，那么本书还是挺适合你的，不会有什么难度。书中的前三章是基础数学内容，往后的难度依次递增。</p> <ul><li>书籍获取：关注公众号：bugstack虫洞栈，回复：<code>程序员数学</code>，下载这本书</li> <li>在线Wiki：<a href="https://jeremykun.com/primers/" target="_blank" rel="noopener noreferrer">https://jeremykun.com/primers/<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <h2 id="六、总结"><a href="#六、总结" class="header-anchor">#</a> 六、总结</h2> <ul><li>Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians. <a href="https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html" target="_blank" rel="noopener noreferrer">https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD498.html<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li>单纯的只会数学写不了代码，能写代码的不懂数学只能是CRUD码农。数学知识帮助你设计数据结构和实现算法逻辑，代码能力帮你驾驭设计模式和架构模型。多方面的知识结合和使用才是码农和工程师的主要区别，也是是否拥有核心竞争力的关键点。</li> <li>学习知识有时候看不到前面的路有多远，但哪怕是个泥坑，只要你不停的蠕动、折腾、翻滚，也能抓出一条泥鳅。<code>知识的路上是发现知识的快乐，还学会知识的成就感，不断的促使你前行</code>。</li></ul> <h2 id="七、系列推荐"><a href="#七、系列推荐" class="header-anchor">#</a> 七、系列推荐</h2> <ul><li><a href="https://bugstack.cn/itstack-code-life/2021/01/10/%E6%8F%A1%E8%8D%89-%E8%BF%99%E4%BA%9B%E7%A0%94%E5%8F%91%E4%BA%8B%E6%95%8530-%E6%88%91%E9%83%BD%E5%B9%B2%E8%BF%87.html" target="_blank" rel="noopener noreferrer">互联网大厂，线上研发事故总结！<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://bugstack.cn/itstack-code-life/2020/12/13/%E7%A0%81%E5%BE%B7%E9%9C%80%E6%B1%82-%E8%BF%99%E4%B8%8D%E5%B0%B1%E6%98%AF%E4%BA%A7%E5%93%81%E7%BB%99%E6%88%91%E7%95%99%E7%9A%84%E6%95%B0%E5%AD%A6%E4%BD%9C%E4%B8%9A.html" target="_blank" rel="noopener noreferrer">码德，这不就是产品给我留的数学作业！<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://bugstack.cn/interview/2020/08/07/%E9%9D%A2%E7%BB%8F%E6%89%8B%E5%86%8C-%E7%AC%AC3%E7%AF%87-HashMap%E6%A0%B8%E5%BF%83%E7%9F%A5%E8%AF%86-%E6%89%B0%E5%8A%A8%E5%87%BD%E6%95%B0-%E8%B4%9F%E8%BD%BD%E5%9B%A0%E5%AD%90-%E6%89%A9%E5%AE%B9%E9%93%BE%E8%A1%A8%E6%8B%86%E5%88%86-%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0.html" target="_blank" rel="noopener noreferrer">HashMap核心知识，扰动函数、负载因子、扩容链表拆分，深度学习<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://bugstack.cn/itstack-demo-netty-3/2020/03/04/Netty+JavaFx%E5%AE%9E%E6%88%98-%E4%BB%BF%E6%A1%8C%E9%9D%A2%E7%89%88%E5%BE%AE%E4%BF%A1%E8%81%8A%E5%A4%A9.html" target="_blank" rel="noopener noreferrer">Netty实战，1比1仿桌面版微信聊天<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/vuejs/vuepress/edit/master/packages/docs/docs/notes/程序员和数学.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021/1/23 下午1:08:04</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/notes/" class="prev router-link-active">
        主题
      </a></span> <span class="next"><a href="/notes/using-a-theme.html">
        使用主题
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><!----></div></div>
    <script src="/assets/js/app.28715422.js" defer></script><script src="/assets/js/5.cdfc0b9f.js" defer></script><script src="/assets/js/44.aab84de2.js" defer></script><script src="/assets/js/9.4c44b987.js" defer></script>
  </body>
</html>
